﻿using JV.Com.Internals;
using JV.Com.ViewModels;
using JV.Com.ViewModels.Wrapper;
using Microsoft.Practices.Prism.StoreApps;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace JV.Com.Views
{
    public sealed partial class SearchResultPage : PageBase
    {
        public SearchResultPage()
        {
            this.InitializeComponent();
            this.Loaded += SearchResultPage_Loaded;
        }

        async void SearchResultPage_Loaded(object sender, RoutedEventArgs e)
        {
            SearchResultSource.Source = await (DataContext as SearchResultPageViewModel).SearchCurrentQueryAsync();
        }

        private void Search_ItemClick(object sender, ItemClickEventArgs e)
        {
            (e.ClickedItem as SearchResultGameWrapper).OnClick();
        }
    }
}
